package com.springbooti18n.controll;

import com.springbooti18n.model.FormData;
import com.springbooti18n.model.Home;
import com.springbooti18n.validate.request.FormValidate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

/**
 * xufan
 * 2019/1/8
 */

@RestController
public class CrossOriginTest {


    @PostMapping("/testCors")
    public void testCors(Home home ) throws  Exception{

        System.out.println(home.getAddDress());

    }


    @PostMapping("/testCors222")
    public void testCors( ) throws  Exception{

        System.out.println("========");

    }


    @PostMapping("/validate_test22")
    public FormData validate_test(
            @RequestBody @FormValidate(beanName = "orgNo=111") FormData formData ,
            @RequestHeader(required = false) String lang){
        System.out.println("aaaaaaaaaaaa");
        return formData;
    }
}
